# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kpeople5
pkgver=5.116.0
pkgrel=0
pkgdesc="A library that provides access to all contacts and the people who hold them"
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later"
depends="qt5-qtbase-sqlite"
depends_dev="
	kcoreaddons5-dev
	ki18n5-dev
	kitemviews5-dev
	kservice5-dev
	kwidgetsaddons5-dev
	qt5-qtdeclarative-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
_repo_url="https://invent.kde.org/frameworks/kpeople.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kpeople-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/kpeople-$pkgver"

replaces="kpeople<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# personsmodeltest fails
	ctest --test-dir build --output-on-failure -E '(personsmodeltest)'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3cbd62d9696592b654a9568d5789eb0acc370e4fcb174938db23a0ac03949f9fe174d6ff4abe35a7132319c725349be2520d7857a9d0b83048df23bb38f76232  kpeople-5.116.0.tar.xz
"
